import request from '@/utils/request'

/**
 * 登录
 */
export function loginByUsername(data) {
  return request({
    url: '/login?password='+data.password+'&username='+data.username,
    method: 'post',
    data
  })
}

/**
 * 登出
 */
export function logout() {
  return request({
    url: '/login/logout',
    method: 'post'
  })
}

/**
 * 拉取用户信息
 */
export function getUserInfo(token) {
  return request({
    url: '/user/info',
    method: 'get',
    params: { token }
  })
}
